{	Problem: http://codeforces.ru/problemset/problem/70/A
 	Verdict: Accepted
}
const m=1000003;
var i,r,n:longint;
begin
read(n);
r:=1;
for i:=2 to n do
  r:=r*3 mod m;
write(r);
end.